<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<html>
	<!-- Mirrored from www.zi-han.net/theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>H+ 后台主题UI框架 - jqGird</title>
		<%@ include file="/WEB-INF/pages/common/inc.jsp"%>
		<!-- jqgrid-->
		<link href="${ctxStatic}/css/plugins/jqgrid/ui.jqgridffe4.css?0820" rel="stylesheet">
		<style>
			.ui-jqgrid-sortable,.jqgrow,.ui-pg-table,.EditTable{
				font-size:12px;
			}
		</style>
	</head>

	<body>
		<table id="table_list_2"></table>
		<div id="pager_list_2"></div>
		<script src="${ctxStatic}/js/jquery.min.js?v=2.1.4"></script>
		<script src="${ctxStatic}/js/bootstrap.min.js?v=3.3.6"></script>
		<script src="${ctxStatic}/js/plugins/jqgrid/i18n/grid.locale-cnffe4.js?0820"></script>
		<script src="${ctxStatic}/js/plugins/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
		<script src="${ctxStatic}/js/content.min.js?v=1.0.0"></script>
		<script src="${ctxStatic}/js/plugins/layer/layer.min.js"></script>
		<script>
			$(document).ready(function() {
				$("#table_list_2").css('fontSize','14px');
				$("#pager_list_2").css('fontSize','14px');
				$.jgrid.defaults.styleUI = "Bootstrap";
				$("#table_list_2").jqGrid({
					url : '${ctx}/admin/info/listnews',
					datatype : "json",
					height : "400",
					autowidth : true,
					shrinkToFit : true,
					rownumbers : true,
					viewrecords : true,
					rowNum : 10,
					rowList : [ 10, 20, 30 ],
					colNames : [ "序号", "标题", "内容", "日期", "图片", "类型","操作"],
					colModel : [ {
						name : "id",
						index : "id",
						editable : true,
						hidden : true,
						key : true
					}, {
						name : "title",
						index : "title",
						editable : true
					}, {
						name : "context",
						index : "context",
						hidden : true,
						editable : true
					}, {
						name : "date",
						index : "date",
						editable : true
					}, {
						name : "imgurl",
						index : "imgurl",
						editable : true,
						hidden:true
					}, {
						name : "type",
						index : "type",
						editable : true,
						edittype : "select",
						editoptions : {
							value : "1:新闻资讯;2:技术;3:文章;4:视频;5:展会"
						}
					},{
						name:"操作",
						index:"操作",
						formatter:function(cellvalue, options, rowObject){
							var text = "<a href='${ctx}/admin/info/operateInfo?oper=look&id="+rowObject.id+"' class='btn btn-white btn-bitbucket'><i class='fa fa-search'></i></a><a href='${ctx}/admin/info/operateInfo?oper=edit&id="+rowObject.id+"' class='btn btn-white btn-bitbucket'><i class='fa fa-wrench'></i></a>";
							return text;
						}
					}],
					pager : "#pager_list_2",
					sortname : 'id',
					editurl : "${ctx}/admin/user/editnews",
					sortorder : "desc"
				});
				$("#table_list_2").jqGrid("navGrid", "#pager_list_2", {
					add:false,
					edit:false,
					del : true,
					search : false
				}, {

				}, {

				}, {
					url : "${ctx}/admin/info/delnews"
				}, {});
			})
		</script>
	</body>
</html>